/*
 * @Author: zhoujinlong 765637726@qq.com
 * @Date: 2024-03-26 08:58:45
 * @LastEditors: zhoujinlong 765637726@qq.com
 * @LastEditTime: 2024-03-28 11:05:26
 * @FilePath: \election-yd\electron.vite.config.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
 
  main: {
    plugins: [externalizeDepsPlugin()]
  },
  preload: {
    plugins: [externalizeDepsPlugin()]
  },

  renderer: {
    resolve: {
      alias: {
        '@renderer': resolve('src/renderer/src'),
        '@/': resolve('src/renderer/src')
      } 
    },
    base:"./", 
    server: {
      host:"0.0.0.0",
      port:5175,
      proxy: {
        "/api": {
          target: "http://47.92.249.56:9993/",
          changeOrigin: true, //是否跨域 
          rewrite: (path) => path.replace(/^\/api/, ""),
        },
      }, 
    },
    // build: {
    //   outDir: "super-admin-manager",
    //   assetsDir: "assets", //指定静态资源存放路径
    //   sourcemap: false, //是否构建source map 文件
    //   terserOptions: {
    //     // 生产环境移除console
    //     compress: { 
    //       drop_console: true,
    //       drop_debugger: true,
    //     },
    //   },
    //   // minify: "terser",
    //   // target: ["edge90", "chrome90", "firefox90", "safari15"], // 适配低版本浏览器
    //   // rollupOptions: {
    //   //   external: ["element-plus"],
    //   // },
    // },
    plugins: [vue()]
  }
})
